package com.monkeyboy.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @Author Gavin
 * @date 2020.08.18 17:52
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = "springboot-mq", selectorExpression = "*", consumeMode = ConsumeMode.CONCURRENTLY, consumerGroup = "${rocketmq.producer.group}")
public class RockeMQConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String msg) {
        log.info("Receive message：" + msg);
    }
}
